/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.haiberg.osgi.bundle.reportcaller.tracker;

import com.haiberg.osgi.bundle.reportservice.ReportRequestHandler;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;

/**
 *
 * @author gyue
 */
public class ReportServiceTracker extends ServiceTracker{
    
    public ReportServiceTracker(BundleContext context){
        super(context, ReportRequestHandler.class.getName(), null);
    }

    @Override
    public Object addingService(ServiceReference reference) {
        System.out.println("com.haiberg.osgi.bundle.reportcaller.tracker.ReportServiceTracker.addingService()");
        ReportRequestHandler requestHandler = (ReportRequestHandler) this.context.getService(reference);
        return requestHandler;
    }
}
